import Vue from 'vue';

import VueAwesomeSwiper from 'vue-awesome-swiper';
import 'swiper/dist/css/swiper.css';
import VueQriously from 'vue-qriously';

import enUS from 'vant/lib/locale/lang/en-US';
import wx from 'jweixin-wechat'

import AlloyFinger from 'alloyfinger'
import AlloyFingerPlugin from 'alloyfinger/vue/alloy_finger_vue'

import App from './App.vue';
import router from 'router';
import store from 'store';
import html2canvas from 'html2canvas'
// import '@/utils/diractives.js'

import 'components/global' // 全局组件注册
import Vant from 'vant';
Vue.use(AlloyFingerPlugin, {
  AlloyFinger
})
Vue.use(VueQriously);
Vue.use(VueAwesomeSwiper);

Vue.use(Vant);
import 'vant/lib/index.css';


Vue.config.productionTip = false;

router.beforeEach((to, from, next) => {
  next() // 确保一定要调用 next()
  // 判断#号之前是否有问号
  let hrefArray = location.href.split('#')
  let hasMak = hrefArray[0].split('/')
  let Mark = hasMak[hasMak.length - 1]
  if (Mark == '' || Mark.search(/\?/) === -1) {
    Mark = '?accessFrom=live#'
    // console.log(Mark)
    location.href = location.href.replace('#', Mark)
  }
})
router.afterEach(() => {

})

new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app');
